﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace OpenCompiler.CodeGen
{
	public enum MethodBodyContext
	{
		Pre=1,
		Body,
		Post
	}


	public interface IMethodBodyBuilder
	{
		IMethodBodyBuilder Statement(Expression<Action> statement);
		IMethodBodyBuilder ReturnStatement<TResult>(Expression<Func<TResult>> statement);

		Expression BodyWithoutReturnStatement { get; }
		Expression Body { get; }
		Expression ReturnStatementBody { get; }
		MethodBodyContext Context { get; }
		IMethodBuilder MethodBuilder { get;  }
	}

	public interface IMethodBodyBuilder<T> : IMethodBodyBuilder
	{
		IMethodBodyBuilder<T> Statement(Expression<Action<T>>  statement);
	}

	public interface IMethodBodyBuilder<T, E> : IMethodBodyBuilder
		where T : class
		where E : Expression
	{
		IMethodBodyBuilder<T, E> Statement(E statement);
		IMethodBodyBuilder<T, E> ReturnStatement(E statement);
	}
}
